﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using System.IO;
using System.Diagnostics;
using PSE.Framework.ErrorLogging;

namespace PSE.Framework.Communication.Spb.Common
{
    public static class Logger
    {
        public static void Write(Exception ex)
        {
            ErrorLogger.WriteLog(LogType.Error, ex);

            //string formattedException = FormatExceptionMessage(ex);
            //EventLog.WriteEntry("SPB Communication", formattedException, EventLogEntryType.Error);
        }

        //public static string FormatExceptionMessage(Exception exception)
        //{
        //    StringWriter sw = null;
        //    using (sw = new StringWriter())
        //    {
        //        TextExceptionFormatter exceptionFormatter = new TextExceptionFormatter(sw, exception);
        //        exceptionFormatter.Format();
        //    }
        //    return sw.ToString();
        //}
    }
}
